package cn._51doit.flink.day08;

import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

/**
 * 使用同步方式根据经纬度，查询高德地图，关联位置信息
 */
public class GetLocation {

    public static void main(String[] args) {


        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();

        //测试数据
        //{"oid": "o1000", "cid": "c10", "money": 99.99, "longitude": 116.413467, "latitude": 39.908072}
        //{"oid": "o1001", "cid": "c11", "money": 99.99, "longitude": 115.413467, "latitude": 39.908072}
        //{"oid": "o1000", "cid": "c10", "money": 99.99, "longitude": 116.413467, "latitude": 39.908072}
        //{"oid": "o1001", "cid": "c11", "money": 99.99, "longitude": 116.413467, "latitude": 39.908072}
        //{"oid": "o1000", "cid": "c10", "money": 99.99, "longitude": 116.413467, "latitude": 39.908072}
        //{"oid": "o1001", "cid": "c11", "money": 99.99, "longitude": 116.413467, "latitude": 39.908072}
        DataStreamSource<String> lines = env.socketTextStream("localhost", 8888);
        //希望得到结果
        //{"oid": "o1000", "cid": "c10", "money": 99.99, "longitude": 116.413467, "latitude": 39.908072, "province": "河北省", "city": "廊坊市"}

        //先使用同步非方式查询，new RichMapFunction
        //使用HttpClient（Java发送http请求的客户端）调用高德地图的API


    }
}
